Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Memory-mapped file</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Memory-mapped_file"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Memory-mapped_file rootpage-Memory-mapped_file skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Memory-mapped file</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">Not to be confused with <a href="Memory-mapped_I/O" class="mw-redirect" title="Memory-mapped I/O">Memory-mapped I/O</a>.</div>
<p><sup id="cite_ref-:1_1-0" class="reference"><a href="#cite_note-:1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
A <b>memory-mapped file</b> is a segment of <a href="Virtual_memory" title="Virtual memory">virtual memory</a><sup id="cite_ref-:0_2-0" class="reference"><a href="#cite_note-:0-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> that has been assigned a direct byte-for-byte correlation with some portion of a file or file-like resource. This resource is typically a file that is physically present on disk, but can also be a device, <a href="Shared_memory" title="Shared memory">shared memory</a> object, or other resource that an <a href="Operating_system" title="Operating system">operating system</a> can reference through a <a href="File_descriptor" title="File descriptor">file descriptor</a>. Once present, this correlation between the file and the memory space permits applications to treat the mapped portion as if it were primary memory.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<div class="mw-heading mw-heading3"><h3 id="TOPS-20_PMAP">TOPS-20 PMAP</h3></div>
<p>An early (<abbr title="circa">c.</abbr><span style="white-space:nowrap;"> 1969</span>)<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> implementation of this was the <b>PMAP</b> system call on the <a href="DECSYSTEM-20" title="DECSYSTEM-20">DEC-20</a>'s <a href="TOPS-20" title="TOPS-20">TOPS-20</a> operating system,<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> a feature used by Software House's <a href="System_1022_(database)" class="mw-redirect" title="System 1022 (database)">System-1022 database system</a>.<sup id="cite_ref-:1_1-1" class="reference"><a href="#cite_note-:1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="SunOS_4_mmap">SunOS 4 mmap</h3></div>
<p>SunOS 4<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> introduced <a href="Unix" title="Unix">Unix</a>'s <code><a href="Mmap" title="Mmap">mmap</a></code>, which permitted programs "to map files into memory."<sup id="cite_ref-:0_2-1" class="reference"><a href="#cite_note-:0-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Windows_Growable_Memory-Mapped_Files_(GMMF)">Windows Growable Memory-Mapped Files (GMMF)</h3></div>
<p>Two decades after the release of TOPS-20's PMAP, <a href="Windows_NT" title="Windows NT">Windows NT</a> was given Growable Memory-Mapped Files (GMMF).
</p><p>Since "<code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">CreateFileMapping</code> function requires a size to be passed to it" and altering
a file's size is not readily accommodated, a GMMF API was developed.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> Use of GMMF requires
declaring the maximum to which the file size can grow, but no unused space is wasted.
</p>
<div class="mw-heading mw-heading2"><h2 id="Benefits">Benefits</h2></div>
<p>The benefit of memory mapping a file is increasing I/O performance, especially when used on large files. For small files, memory-mapped files can result in a waste of <a href="Slack_space" class="mw-redirect" title="Slack space">slack space</a><sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> as memory maps are always aligned to the page size, which is mostly 4 KiB. Therefore, a 5 KiB file will allocate 8 KiB and thus 3 KiB are wasted. Accessing memory mapped files is faster than using direct read and write operations for two reasons. Firstly, a system call is orders of magnitude slower than a simple change to a program's local memory. Secondly, in most operating systems the memory region mapped actually <i>is</i> the kernel's <a href="Page_cache" title="Page cache">page cache</a> (file cache), meaning that no copies need to be created in user space.
</p><p>Certain application-level memory-mapped file operations also perform better than their physical file counterparts. Applications can access and update data in the file directly and in-place, as opposed to seeking from the start of the file or rewriting the entire edited contents to a temporary location. Since the memory-mapped file is handled internally in pages, linear file access (as seen, for example, in <a href="Flat_file" class="mw-redirect" title="Flat file">flat file</a> data storage or configuration files) requires disk access only when a new page boundary is crossed, and can write larger sections of the file to disk in a single operation.
</p><p>A possible benefit of memory-mapped files is a "lazy loading", thus using small amounts of RAM even for a very large file. Trying to load the entire contents of a file that is significantly larger than the amount of memory available can cause severe <a href="Thrashing_(computer_science)" title="Thrashing (computer science)">thrashing</a> as the operating system reads from disk into memory and simultaneously writes pages from memory back to disk. Memory-mapping may not only bypass the page file completely, but also allow smaller page-sized sections to be loaded as data is being edited, similarly to <a href="Demand_paging" title="Demand paging">demand paging</a> used for programs.
</p><p>The memory mapping process is handled by the <a href="Virtual_memory" title="Virtual memory">virtual memory manager</a>, which is the same subsystem responsible for dealing with the <a href="Page_file" class="mw-redirect" title="Page file">page file</a>. Memory mapped files are loaded into memory one entire <a href="Memory_page" class="mw-redirect" title="Memory page">page</a> at a time. The <a href="Page_size" class="mw-redirect" title="Page size">page size</a> is selected by the operating system for maximum performance. Since page file management is one of the most critical elements of a virtual memory system, loading page sized sections of a file into physical memory is typically a very highly optimized system function.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Types">Types</h2></div>
<p>There are two types of memory-mapped files:
</p>
<div class="mw-heading mw-heading3"><h3 id="Persisted">Persisted</h3></div>
<p>Persisted files are associated with a source file on a disk. The data is saved to the source file on the disk once the last process is finished. These memory-mapped files are suitable for working with extremely large source files.<sup id="cite_ref-Memory-Mapped_Files_10-0" class="reference"><a href="#cite_note-Memory-Mapped_Files-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Non-persisted">Non-persisted</h3></div>
<p>Non-persisted files are not associated with a file on a disk. When the last process has finished working with the file, the data is lost. These files are suitable for creating shared memory for <a href="Inter-process_communication" title="Inter-process communication">inter-process communications</a> (IPC).<sup id="cite_ref-Memory-Mapped_Files_10-1" class="reference"><a href="#cite_note-Memory-Mapped_Files-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Drawbacks">Drawbacks</h2></div>
<p>The major reason to choose memory mapped file I/O is performance. Nevertheless, there can be tradeoffs. The standard I/O approach is costly due to system call overhead and memory copying. The memory-mapped approach has its cost in <a href="Page_fault#Minor" title="Page fault">minor page faults</a>—when a block of data is loaded in <a href="Page_cache" title="Page cache">page cache</a>, but is not yet mapped into the process's virtual memory space. In some circumstances, memory mapped file I/O can be substantially slower than standard file I/O.<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup>
</p><p>Another drawback of memory-mapped files relates to a given architecture's <a href="Memory_address" title="Memory address">address space</a>: a file larger than the addressable space can have only portions mapped at a time, complicating reading it. For example, a <a href="32-bit" class="mw-redirect" title="32-bit">32-bit</a> architecture such as Intel's <a href="IA-32" title="IA-32">IA-32</a> can only directly address 4 <a href="GiB" class="mw-redirect" title="GiB">GiB</a> or smaller portions of files. An even smaller amount of addressable space is available to individual programs—typically in the range of 2 to 3 GiB, depending on the operating system kernel. This drawback however is virtually eliminated on modern <a href="64-bit" class="mw-redirect" title="64-bit">64-bit</a> architecture.
</p><p>mmap also tends to be less scalable than standard means of file I/O, since many operating systems, including Linux, have a cap on the number of cores handling page faults. Extremely fast devices, such as modern <a href="NVM_Express" title="NVM Express">NVM Express</a> SSDs, are capable of making the overhead a real concern.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup>
</p><p>I/O errors on the underlying file (e.g. its removable drive is unplugged or optical media is ejected, disk full when writing, etc.) while accessing its mapped memory are reported to the application as the SIGSEGV/SIGBUS signals on POSIX, and the EXECUTE_IN_PAGE_ERROR structured exception on Windows. All code accessing mapped memory must be prepared to handle these errors, which don't normally occur when accessing memory.
</p><p>Only hardware architectures with an <a href="Memory_management_unit" title="Memory management unit">MMU</a> can support memory-mapped files. On architectures without an MMU, the operating system can copy the entire file into memory when the request to map it is made, but this is extremely wasteful and slow if only a little bit of the file will be accessed, and can only work for files that will fit in available memory.
</p>
<div class="mw-heading mw-heading2"><h2 id="Common_uses">Common uses</h2></div>
<p>Perhaps the most common use for a memory-mapped file is the <a href="Loader_(computing)" title="Loader (computing)">process loader</a> in most modern operating systems (including <a href="Microsoft_Windows" title="Microsoft Windows">Windows</a> and <a href="Unix-like" title="Unix-like">Unix-like</a> systems.) When a <a href="Process_(computing)" title="Process (computing)">process</a> is started, the operating system uses a memory mapped file to bring the executable file, along with any loadable modules, into memory for execution. Most memory-mapping systems use a technique called <a href="Demand_paging" title="Demand paging">demand paging</a>, where the file is loaded into physical memory in subsets (one page each), and only when that page is actually referenced.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup> In the specific case of executable files, this permits the OS to selectively load only those portions of a process image that actually need to execute.
</p><p>Another common use for memory-mapped files is to share memory between multiple processes. In modern <a href="Protected_mode" title="Protected mode">protected mode</a> operating systems, processes are generally not permitted to access memory space that is allocated for use by another process. (A program's attempt to do so causes <a href="Page_fault#Invalid" title="Page fault">invalid page faults</a> or <a href="Segmentation_violation" class="mw-redirect" title="Segmentation violation">segmentation violations</a>.) There are a number of techniques available to safely share memory, and memory-mapped file I/O is one of the most popular. Two or more applications can simultaneously map a single physical file into memory and access this memory. For example, the Microsoft Windows operating system provides a mechanism for applications to memory-map a shared segment of the system's page file itself and share data via this section.
</p>
<div class="mw-heading mw-heading2"><h2 id="Platform_support">Platform support</h2></div>
<p>Most modern operating systems or runtime environments support some form of memory-mapped file access. The function <style data-mw-deduplicate="TemplateStyles:r886049734">
/* start https://en.wikipedia.org/ */


.mw-parser-output .monospaced{font-family:monospace,monospace}


/* end https://en.wikipedia.org/ */
</style><span class="monospaced"><a href="Mmap" title="Mmap">mmap</a>()</span>,<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup> which creates a mapping of a file given a file descriptor, starting location in the file, and a length, is part of the <a href="POSIX" title="POSIX">POSIX</a> specification, so the wide variety of POSIX-compliant systems, such as <a href="Unix" title="Unix">UNIX</a>, <a href="Linux" title="Linux">Linux</a>, <a href="Mac_OS_X" class="mw-redirect" title="Mac OS X">Mac OS X</a><sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> or <a href="OpenVMS" title="OpenVMS">OpenVMS</a>, support a common mechanism for memory mapping files. The Microsoft Windows operating systems also support a group of <a href="API" title="API">API</a> functions for this purpose, such as <span class="monospaced">CreateFileMapping()</span>.<sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup>
</p><p>Some free portable implementations of memory-mapped files for Microsoft Windows and POSIX-compliant platforms are:
</p>
<ul><li>Boost.Interprocess,<sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup> in <a href="Boost_C%2B%2B_Libraries" class="mw-redirect" title="Boost C++ Libraries">Boost C++ Libraries</a></li>
<li>Boost.Iostreams,<sup id="cite_ref-18" class="reference"><a href="#cite_note-18"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup> also in <a href="Boost_C%2B%2B_Libraries" class="mw-redirect" title="Boost C++ Libraries">Boost C++ Libraries</a></li>
<li>Fmstream<sup id="cite_ref-19" class="reference"><a href="#cite_note-19"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup></li>
<li>Cpp-mmf<sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup></li></ul>
<p>The <a href="Java_(programming_language)" title="Java (programming language)">Java programming language</a> provides classes and methods to access memory mapped files, such as <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/nio/channels/FileChannel.html">FileChannel</a></code>.
</p><p>The <a href="D_(programming_language)" title="D (programming language)">D programming language</a> supports memory mapped files in its standard library (std.mmfile module).<sup id="cite_ref-21" class="reference"><a href="#cite_note-21"><span class="cite-bracket">[</span>21<span class="cite-bracket">]</span></a></sup>
</p><p><a href="Ruby_(programming_language)" title="Ruby (programming language)">Ruby</a> has a gem (library) called Mmap, which implements memory-mapped file objects.
</p><p><a href="Rust_(programming_language)" title="Rust (programming language)">Rust</a> does not provide any mmap functionality in the standard library but there exists a third-party crate (library) called memmap2.<sup id="cite_ref-22" class="reference"><a href="#cite_note-22"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup>
</p><p>Since version 1.6, <a href="Python_programming_language" class="mw-redirect" title="Python programming language">Python</a> has included a <span class="monospaced">mmap</span> module in its Standard Library.<sup id="cite_ref-py-1.6-release-notes_23-0" class="reference"><a href="#cite_note-py-1.6-release-notes-23"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup> Details of the module vary according to whether the host platform is <a href="Microsoft_Windows" title="Microsoft Windows">Windows</a> or <a href="Unix-like" title="Unix-like">Unix-like</a>.
</p><p>For <a href="Perl" title="Perl">Perl</a> there are several modules available for memory mapping files on the <a href="CPAN" title="CPAN">CPAN</a>, such as <span class="monospaced">Sys::Mmap</span><sup id="cite_ref-sys-mmap-cpan-module_24-0" class="reference"><a href="#cite_note-sys-mmap-cpan-module-24"><span class="cite-bracket">[</span>24<span class="cite-bracket">]</span></a></sup> and <span class="monospaced">File::Map</span>.<sup id="cite_ref-file-map-cpan-module_25-0" class="reference"><a href="#cite_note-file-map-cpan-module-25"><span class="cite-bracket">[</span>25<span class="cite-bracket">]</span></a></sup>
</p><p>In the Microsoft .NET runtime, <a href="P/Invoke" class="mw-redirect" title="P/Invoke">P/Invoke</a> can be used to use memory mapped files directly through the <a href="Windows_API" title="Windows API">Windows API</a>. Managed access (P/Invoke not necessary) to memory mapped files was introduced in version 4 of the runtime (see <a rel="nofollow" class="external text" href="http://msdn.microsoft.com/en-us/library/dd997372(v=VS.100).aspx">Memory-Mapped Files</a>). For previous versions, there are third-party libraries which provide managed API's.<sup id="cite_ref-26" class="reference"><a href="#cite_note-26"><span class="cite-bracket">[</span>26<span class="cite-bracket">]</span></a></sup> .NET have the <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">MemoryMappedFile</code> class.<sup id="cite_ref-27" class="reference"><a href="#cite_note-27"><span class="cite-bracket">[</span>27<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-28" class="reference"><a href="#cite_note-28"><span class="cite-bracket">[</span>28<span class="cite-bracket">]</span></a></sup>
</p><p><a href="PHP" title="PHP">PHP</a> supported memory-mapping techniques in a number of native file access functions such as <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">file_get_contents()</code> but has removed this in 5.3 (see <a rel="nofollow" class="external text" href="http://svn.php.net/viewvc?view=revision&amp;revision=255970">revision log</a>).
</p><p>For the <a href="R_(programming_language)" title="R (programming language)">R programming language</a> there exists a library on CRAN called <a rel="nofollow" class="external text" href="https://cran.r-project.org/web/packages/bigmemory/index.html">bigmemory</a> which uses the Boost library and provides memory-mapped backed arrays directly in R. The package <a rel="nofollow" class="external text" href="https://cran.r-project.org/web/packages/ff/index.html">ff</a> offers memory-mapped vectors, matrices, arrays and data frames.
</p><p>The <a href="J_(programming_language)" title="J (programming language)">J programming language</a> has supported memory-mapped files since at least 2005. It includes support for boxed array data, and single datatype files. Support can be loaded from 'data/jmf' J's Jdb and JD database engines use memory-mapped files for column stores.
</p><p>The <a href="Julia_(programming_language)" title="Julia (programming language)">Julia programming language</a> has support for <a href="Input/output" title="Input/output">I/O</a> of memory-mapped binary files through the <code>Mmap</code> module within the Standard Library.<sup id="cite_ref-29" class="reference"><a href="#cite_note-29"><span class="cite-bracket">[</span>29<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist reflist-columns references-column-width" style="column-width: 30em;">
<ol class="references">
<li id="cite_note-:1-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-:1_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:1_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://groups.google.com/d/topic/alt.sys.pdp10/LmLLRrpcK70">"System 1022 Database System"</a>. <q>We had a PMAP cache for file I/O(like PA1050) in extended sections.</q></cite></span>
</li>
<li id="cite_note-:0-2"><span class="mw-cite-backlink">^ <a href="#cite_ref-:0_2-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:0_2-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFChris_Siebenmann2018" class="citation web cs1">Chris Siebenmann (7 June 2018). <a rel="nofollow" class="external text" href="https://utcc.utoronto.ca/~cks/space/blog/unix/SbrkVersusMmap">"The history of Unix's confusing set of low-level ways to allocate memory"</a>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text">Development began 1969, shipped 1976</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.bitsavers.org/pdf/dec/pdp10/TOPS20/AA-4166E-TM_TOPS-20_Monitor_Calls_Reference_Ver_5_Dec82.pdf">"TOPS-20 Monitor Calls Reference Manual"</a> <span class="cs1-format">(PDF)</span>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text">Dec. 1988</span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFJeffrey_Richter1995" class="citation magazine cs1">Jeffrey Richter (October 1995). "Add Growable Memory-Mapped Files to your App". <i>Microsoft Systems Journal</i>. pp.&nbsp;<span class="nowrap">17–</span>28.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://devblogs.microsoft.com/oldnewthing/20150130-00/?p=44793">Creating a shared memory block that can grow in size</a></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20110807115939/http://www.devshed.com/c/a/BrainDump/Using-mmap-for-Advanced-File-IO/">"Using mmap() for Advanced File I/O - BrainDump"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.devshed.com/c/a/BrainDump/Using-mmap-for-Advanced-File-IO/">the original</a> on 7 August 2011<span class="reference-accessdate">. Retrieved <span class="nowrap">21 May</span> 2011</span>.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://msdn.microsoft.com/en-us/library/ms810613.aspx">, "What Do Memory-Mapped Files Have to Offer?".</a></span>
</li>
<li id="cite_note-Memory-Mapped_Files-10"><span class="mw-cite-backlink">^ <a href="#cite_ref-Memory-Mapped_Files_10-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Memory-Mapped_Files_10-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://msdn.microsoft.com/en-us/library/dd997372.aspx">"Memory-Mapped Files"</a>. <i>Microsoft Developer Network</i><span class="reference-accessdate">. Retrieved <span class="nowrap">4 January</span> 2016</span>.</cite></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external free" href="http://lists.freebsd.org/pipermail/freebsd-questions/2004-June/050371.html">http://lists.freebsd.org/pipermail/freebsd-questions/2004-June/050371.html</a>, read vs. mmap (or io vs. page faults) by <a href="Matthew_Dillon_(computer_scientist)" class="mw-redirect" title="Matthew Dillon (computer scientist)">Matthew Dillon</a></span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><cite id="CITEREFPapagiannisXanthakisSaloustrosMarazakis2020" class="citation conference cs1">Papagiannis, Anastasios; Xanthakis, Giorgos; Saloustros, Giorgos; Marazakis, Manolis; Bilas, Angelos (2020). <a rel="nofollow" class="external text" href="https://www.usenix.org/conference/atc20/presentation/papagiannis"><i>Optimizing Memory-mapped I/O for Fast Storage Devices</i></a>. USENIX ATC '20. pp.&nbsp;<span class="nowrap">813–</span>827.</cite></span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.linux-tutorial.info/?page_id=453,">"Demand Paging"</a></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.ecst.csuchico.edu/~beej/guide/ipc/mmap.html">Memory Mapped Files</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20070209012757/http://www.ecst.csuchico.edu/~beej/guide/ipc/mmap.html">Archived</a> 9 February 2007 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://www.apple.com/macosx/technology/unix.html">Apple – Mac OS X Leopard – Technology – UNIX</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20090423231611/http://www.apple.com/macosx/technology/unix.html">Archived</a> 23 April 2009 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></span>
</li>
<li id="cite_note-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-16">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://msdn2.microsoft.com/en-us/library/aa366537.aspx">CreateFileMapping Function (Windows)</a></span>
</li>
<li id="cite_note-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-17">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.boost.org/doc/libs/release/doc/html/interprocess/sharedmemorybetweenprocesses.html#interprocess.sharedmemorybetweenprocesses.mapped_file">"Sharing memory between processes: Memory Mapped Files"</a>. Boost.org.</cite></span>
</li>
<li id="cite_note-18"><span class="mw-cite-backlink"><b><a href="#cite_ref-18">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.boost.org/doc/libs/release/libs/iostreams/doc/classes/mapped_file.html">"Memory-Mapped Files"</a>. Boost.org.</cite></span>
</li>
<li id="cite_note-19"><span class="mw-cite-backlink"><b><a href="#cite_ref-19">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://sourceforge.net/projects/fmstream/">"Memory Mapped Files for Windows and POSIX systems"</a>. SourceForge.</cite></span>
</li>
<li id="cite_note-20"><span class="mw-cite-backlink"><b><a href="#cite_ref-20">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://github.com/carlomilanesi/cpp-mmf">"cpp-mmf"</a>. GitHub.</cite></span>
</li>
<li id="cite_note-21"><span class="mw-cite-backlink"><b><a href="#cite_ref-21">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.digitalmars.com/d/2.0/phobos/std_mmfile.html">"std.mmfile - D Programming Language"</a>. Digital Mars<span class="reference-accessdate">. Retrieved <span class="nowrap">4 December</span> 2011</span>.</cite></span>
</li>
<li id="cite_note-22"><span class="mw-cite-backlink"><b><a href="#cite_ref-22">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://crates.io/crates/memmap2">"crates.io: Rust Package Registry"</a>. <i>crates.io</i><span class="reference-accessdate">. Retrieved <span class="nowrap">18 December</span> 2024</span>.</cite></span>
</li>
<li id="cite_note-py-1.6-release-notes-23"><span class="mw-cite-backlink"><b><a href="#cite_ref-py-1.6-release-notes_23-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20061230034955/http://www.python.org/download/releases/1.6.1/">"New Modules in 1.6"</a>. Archived from <a rel="nofollow" class="external text" href="https://www.python.org/download/releases/1.6.1/#new-modules-in-1-6">the original</a> on 30 December 2006<span class="reference-accessdate">. Retrieved <span class="nowrap">23 December</span> 2008</span>.</cite></span>
</li>
<li id="cite_note-sys-mmap-cpan-module-24"><span class="mw-cite-backlink"><b><a href="#cite_ref-sys-mmap-cpan-module_24-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://metacpan.org/module/Sys::Mmap">"Sys::Mmap Perl Module"</a>.</cite></span>
</li>
<li id="cite_note-file-map-cpan-module-25"><span class="mw-cite-backlink"><b><a href="#cite_ref-file-map-cpan-module_25-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://metacpan.org/module/File::Map">"File::Map Perl Module"</a>.</cite></span>
</li>
<li id="cite_note-26"><span class="mw-cite-backlink"><b><a href="#cite_ref-26">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://winterdom.com/dev/net">DotNet</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20100419135457/http://winterdom.com/dev/net">Archived</a> 19 April 2010 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></span>
</li>
<li id="cite_note-27"><span class="mw-cite-backlink"><b><a href="#cite_ref-27">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://learn.microsoft.com/en-us/dotnet/api/system.io.memorymappedfiles.memorymappedfile">"MemoryMappedFile Class (System.IO.MemoryMappedFiles)"</a>. <i>learn.microsoft.com</i><span class="reference-accessdate">. Retrieved <span class="nowrap">20 October</span> 2024</span>.</cite></span>
</li>
<li id="cite_note-28"><span class="mw-cite-backlink"><b><a href="#cite_ref-28">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://learn.microsoft.com/en-us/dotnet/standard/io/memory-mapped-files">"Memory-Mapped Files - .NET"</a>. <i>learn.microsoft.com</i>. 14 December 2022<span class="reference-accessdate">. Retrieved <span class="nowrap">20 October</span> 2024</span>.</cite></span>
</li>
<li id="cite_note-29"><span class="mw-cite-backlink"><b><a href="#cite_ref-29">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.julialang.org/en/v1/stdlib/Mmap/#Mmap.mmap">"Memory-mapped I/O · The Julia Language"</a>. <i>docs.julialang.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">3 September</span> 2023</span>.</cite></span>
</li>
</ol></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-06-17" href="https://en.wikipedia.org/wiki/?title=Memory-mapped_file&amp;oldid=1296067805">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>